﻿using System.Web.Mvc;
using System.Web.Script.Serialization;
using Services.Implementations;

namespace Socaloud.Controllers {

    public class HomeController : Controller {

        public ActionResult Index() {
            return View();
        }

        public ActionResult Match(string id) {
            if(string.IsNullOrEmpty(id)) {
                return  RedirectToAction("Index");
            }

            ViewBag.MatchId = id;
            ViewBag.Hashtags = new JavaScriptSerializer().Serialize(new XmlSoccerService().GetMatchHashtags(id));
            return View();
        }

    }
}
